<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        document.addEventListener("DOMContentLoaded", () => {
            let counter = 0;

            document.querySelector("#increase").onclick = () => {
                counter++;
                document.querySelector('h1').innerHTML = counter;
            }

            document.querySelector("#decrease").onclick = () => {
                counter--;
                document.querySelector('h1').innerHTML = counter;
            }
        })
    </script>
</head>
<body>
<h1>0</h1>
<button id="increase">+</button>
<button id="decrease">-</button>
</body>
</html>